home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
compuserve-file-archive
/
23 Geos Applications
/
GEMOUS.THD
< prev
next >
Wrap
Text File
|
2019-04-13
|
10KB
|
292 lines
#: 9961 S3/geoProgramming
13-Aug-92 14:21:20
Sb: #Mouse and Dialog Box
Fm: dennis sherren 74326,3212
To: all
Does anyone know how to confine the movement of the mouse to stay within the
boundry of a dialog box? I can confine the mouse outside a dialog box but not
within. I must be missing something. Any hints or tips in this area would be
appreciated!
* Reply: 9966
#: 9966 S3/geoProgramming
14-Aug-92 11:15:16
Sb: #9961-#Mouse and Dialog Box
Fm: Joe Buckley/geoSysOp 71570,2600
To: dennis sherren 74326,3212 (X)
Dennis,
I can't recall if I've ever tried to restrict mouse movements to within a
dialog box area, but it should work the same as when outside a DB.
In your definition for the dialog box add a call for your own modifier code
with:
.byte DB_USR_ROUT
.word Your_Routine_Name
In you routine, simply:
Your_Routine_Name:
LoadB mouseTop,Your_DBs_Top_Edge
LoadB mouseBottom,Your_DBs_Bottom_Edge
LoadW mouseLeft,Your_DBs_Left_Edge
LoadW mouseRight,Your_DBs_Right_Edge
rts
This should work.
If I recall the use correctly, the mouse should remain within the window
specified and on an attempt to move beyond those boundaries, a call is made
through mouseFaultVec ($84A7).
You should also be able to determine what type of fault occurred by checking
the value of faultData ($84B6).
The constants to use are:
SET_OFFTOP == %10000000
SET_OFFBOTTOM == %01000000
SET_OFFLEFT == %00100000
SET_OFFRIGHT == %00010000
Generally, you wouldn't have to worry about these.
You also don't need to worry about restoring these values, since they are
preserved by the system and restored upon DB exit by the system.
If there is anything else you may need help on (or if this doesn't work),
feel free to ask.
Joe
* Reply: 9969
#: 9969 S3/geoProgramming
14-Aug-92 16:13:52
Sb: #9966-#Mouse and Dialog Box
Fm: dennis sherren 74326,3212
To: Joe Buckley/geoSysOp 71570,2600 (X)
Joe -- Thanks for your timely reply. That is what i have been trying to do,
will reexamine my code and try again. I can get that technique to work outside
of the DB but it seams to not work in the DB. I am using GEOS 128 - 2.0 and am
experimenting with color on the 80 column screen. I have reduxced the screen to
176 pixel height. However the mouse at times thinks it is still 200 pixels and
blindly wanders of the screen and into the color attribute memory. Makes for
some very interesting unintended color effects. I'll post a note and let you
know how I did.
As soon as I get around taht bug I'll have a nice geos program for upload.
Thanks again!
Dennis
* Replies: 9972, 9974
#: 9972 S3/geoProgramming
14-Aug-92 18:10:44
Sb: #9969-#Mouse and Dialog Box
Fm: dennis sherren 74326,3212
To: dennis sherren 74326,3212 (X)
Tried it again and it still doesnt work within a DB. Any other suggestions
would be greatly appreciated.
Dennis
* Reply: 9976
#: 9976 S3/geoProgramming
14-Aug-92 21:48:00
Sb: #9972-#Mouse and Dialog Box
Fm: Joe Buckley/geoSysOp 71570,2600
To: dennis sherren 74326,3212 (X)
Dennis,
I located the trouble.
When you use a dialog box, any time you have a system icon in use, the
value of mouseBottom ($84B9) gets reset to 199 ($C7).
I tracked this down to the call DoDlgBox makes to DoIcons which, in
turn calls a small internal routine to reset the values of mouseTop,
mouseBottom, mouseLeft, and mouseRight to their maximums.
Why? I honestly can't say. The menu handler also calls this routine.
The easiest, if not the most glamorous, solution is to make a temporary
patch to the kernal to prevent this.
At the start of you program, preserve the contents of the byte at $FB64
(which is 199, or $C7). Then simply load this byte with the maximum you wish
to work with. My program assumes a default mouse pointer, so I use 169 ($A9).
Just be sure to restore the original value before exiting your program.
Let me know how this works.
Joe
* Replies: 9977, 9994
#: 9977 S3/geoProgramming
14-Aug-92 21:49:24
Sb: #9976-Mouse and Dialog Box
Fm: Joe Buckley/geoSysOp 71570,2600
To: Joe Buckley/geoSysOp 71570,2600 (X)
BTW, this location is for GEOS 128 V2.0 only.
I'll try looking it up for V1.4.
#: 9994 S3/geoProgramming
15-Aug-92 17:33:07
Sb: #9976-#Mouse and Dialog Box
Fm: dennis sherren 74326,3212
To: Joe Buckley/geoSysOp 71570,2600 (X)
Joe: Many thanks - your suggestion did the trick. The mouse is now well
behaved. I also did a little looking with geoDebugger and I believe the
location to change for Ver. 1.4 ( actually 1.3 in the kernal) is $fb67. Had to
put a little code in for prgram to check which kernal it was running under and
patch accordingly. You also have to undo your patching as you leave the
porgram!! ( I found that out the hard way!)
I'm still 'shaking' from having to invoke powerful magic on this program.
Tinkering with the kernal is not for the feeble of heart!
Again many, many thanks for your help!
Dennis
* Reply: 9996
#: 9996 S3/geoProgramming
15-Aug-92 21:35:04
Sb: #9994-#Mouse and Dialog Box
Fm: Joe Buckley/geoSysOp 71570,2600
To: dennis sherren 74326,3212 (X)
Dennis,
Thanks for looking up that data for GEOS 128 V1.3, now I don't have to look
it up! :)
Yup, it does complicate things checking which kernal version you are
running, but such things are straightforward in execution.
Restoring temporary patches like this is essential to keeping an even keel!
BTW, what kind of game is this going to be? Just curious.
Joe
* Reply: 10000
#: 10000 S3/geoProgramming
16-Aug-92 16:10:38
Sb: #9996-#Mouse and Dialog Box
Fm: dennis sherren 74326,3212
To: Joe Buckley/geoSysOp 71570,2600 (X)
If you must know..... <smile> Its a slot machine simulator. But Ive really had
some fun making this thing able to run on Geos 64 and 128 and the 80 column
screen. Call an exercise in compatible programming. It also makes extensive use
of color to brighten things up. And last but not least there is a sound effect
-- the bell rings when you win!
Its a silly little program but it has been a good learning experience. With
some luck, a little final polishing i should be able to upload it within a week
or so. I'm happy with it now that the mouse does not wander off the bottom of
the 80 colum screen. Thanks again!
Dennis
* Replies: 10005, 10007
#: 10005 S3/geoProgramming
16-Aug-92 19:16:24
Sb: #10000-Mouse and Dialog Box
Fm: Bill Roberson/SysOp 73320,1550
To: dennis sherren 74326,3212 (X)
Dennis,
Congratulations on posting message # 10,000.
8) Bill 8)
#: 10007 S3/geoProgramming
17-Aug-92 05:39:50
Sb: #10000-#Mouse and Dialog Box
Fm: Joe Buckley/geoSysOp 71570,2600
To: dennis sherren 74326,3212 (X)
Dennis,
Just for curiosity's sake: I assume there is no improvement that gaining
the 16 scanlines might have?
When I wrote Parallax, it was originally a 40 column mode/color, using
sprites for a 'startburst' effect.
Then I said "Let's make an 80 column version", and needed to totally rewrite
the color handler.
Then I said "Let's put 40/80 column color in one version". What a pain! I
had to rewrite the color handler again, so I could have the same code drive
both video modes (to cut down code size).
The game is played on a 19x10 grid, but with 80 column color, the loss of
the 16 scanlines forced me to reduce the grid to 19x9.
I then rerewrote (!) it so that it would detect the presence of a 64K video
RAM chip set and use the expanded 640x200, 8x8 color cell video mode, giving me
a good simulation of the 40 column screen.
If you have any more programming questions, please ask.
I must say that I enjoyed this exchange quite a bit. I have let my GEOS
programming skills get a bit rusty, and found this investigation refreshing.
Good luck on the rest of the program. I look forward to seeing the finished
product.
Joe
P.S.
Congratulations on posting message #10000!
* Reply: 10009
#: 10009 S3/geoProgramming
17-Aug-92 18:31:29
Sb: #10007-Mouse and Dialog Box
Fm: dennis sherren 74326,3212
To: Joe Buckley/geoSysOp 71570,2600
Well i went into the program trying to design a program which would run on any
C64/128 machine with any GEOS version. So the extra 16 scanlines would have
been nice but I planned around them so I dont really need them. (In fact it
would be nice to whack them off the bottom of the 40 colum screen so it would
be identical to the 80 column!) But thats another exercise for another day.
The program is fini! But i am gonna play with it a day or so longer to be sure
there are no hidden bugs. Look for it towards Friday.
Dennis
PS getting message 10000 was dumb luck! Do I get a prize??
How about a months worth of Compuserve! Last months bill
was a lulu! --- That CB channel can be addicting!
#: 9974 S3/geoProgramming
14-Aug-92 19:43:19
Sb: #9969-Mouse and Dialog Box
Fm: Joe Buckley/geoSysOp 71570,2600
To: dennis sherren 74326,3212 (X)
Dennis,
I've only written two GEOS 128/80 column color programs. I, too, have seen
the interesting color effects that moving the mouse to the screen bottom
causes.
I know in one program (PaintView III, an 80 column color geoPaint viewer) I
believe I disabled the mouse pointer, so that wasn't a problem for me.
In the other (Parallax, a 40/80 column game), I had to keep the mouse from
venturing too far down the screen when using a C128 with only 16K of video RAM.
I don't believe I had any dialog boxes pop up at this point, though its been a
while.
I'll dig out the program and its code and experiment with it.
If mouseBottom is decreased to 175, the mouse should stay on the visible
screen. Remember that mouse position is determined by the 'hot spot' at its
top left corner, so the mouse pointer's 'tail' still droops below the visible
screen.
Joe